package com.wangsd.web.report.mapper;

import com.wangsd.web.report.entity.BillRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author generator
 * @since 2019-10-15
 */
public interface BillRecordMapper extends BaseMapper<BillRecord> {

    @Select("select sum(total_amount) from bill_record where  sub_mch_id = #{subMchId} and report_status = #{status}")
    Double selectTotalFee(@Param("subMchId") String subMchId, @Param("status") int status);

    @Update("update bill_record set report_status = 1 where sub_mch_id = #{subMchId}")
    void updateStatusBySubMchId(@Param("subMchId") String subMchId);
}
